package com.haixiaoke.saas.workOrder.service;

import com.haixiaoke.saas.workOrder.domain.WorkOrderPerson;

import java.util.List;

/**
 * 工单人员信息Service接口
 *
 * @author xiaolong
 * @date 2024-09-02
 */
public interface IWorkOrderPersonService {
    /**
     * 查询工单人员信息
     *
     * @param workOrderPersonId 工单人员信息主键
     * @return 工单人员信息
     */
    WorkOrderPerson selectWorkOrderPersonByWorkOrderPersonId(Long workOrderPersonId);

    /**
     * 查询工单人员信息列表
     *
     * @param workOrderPerson 工单人员信息
     * @return 工单人员信息集合
     */
    List<WorkOrderPerson> selectWorkOrderPersonList(WorkOrderPerson workOrderPerson);

    /**
     * 新增工单人员信息
     *
     * @param workOrderPerson 工单人员信息
     * @return 结果
     */
    int insertWorkOrderPerson(WorkOrderPerson workOrderPerson);

    /**
     * 修改工单人员信息
     *
     * @param workOrderPerson 工单人员信息
     * @return 结果
     */
    int updateWorkOrderPerson(WorkOrderPerson workOrderPerson);

    /**
     * 批量删除工单人员信息
     *
     * @param workOrderPersonIds 需要删除的工单人员信息主键集合
     * @return 结果
     */
     int deleteWorkOrderPersonByWorkOrderPersonIds(Long[] workOrderPersonIds);

    /**
     * 删除工单人员信息信息
     *
     * @param maintenanceId 工单人员信息主键
     * @return 结果
     */
     int deleteWorkOrderPersonByWorkOrderPersonId(Long maintenanceId);

    /**
     * 新增工单人员信息
     * @param workOrderPerson 工单人员信息
     * @return
     */
    int addWorkOrderPerson(WorkOrderPerson workOrderPerson);

    /**
     * 查询工单人员信息及工单数量
     * @return 工单人员信息
     */
    List<WorkOrderPerson> selectWorkOrderPersonAndWorkOrder(WorkOrderPerson workOrderPerson);

    /**
     * 根据b端用户id查询工单人员信息
     * @param busUserId b端用户id
     * @param tenantId  机构id
     * @return
     */
    WorkOrderPerson selectWorkOrderPersonByBusUserId(Long busUserId, String tenantId);

    /**
     * 查询工单人员信息及待处理工单数量
     * @param workOrderPerson 工单人员信息
     * @return 工单人员信息
     */
    List<WorkOrderPerson> selectWorkOrderPersonAndPendingWorkOrder(WorkOrderPerson workOrderPerson);

    /**
     * 更新工单人员最新接单时间
     * @param tenantId 工单人员所属机构id
     * @param busUserId 工单人员id
     * @return
     */
    int updateWorkOrderPersonLatestOrderTime(String tenantId, Long busUserId);
}
